<?php
$_SESSION['shop_return_url'] = $_SERVER['REQUEST_URI'];
	
	$rowsPerPage = isset($_GET['num'])?$_GET['num']:'10';
	$Successmsg = (isset($_GET['success'])) ? $_GET['success'] : '';
?>
<style type="text/css">
.showDragHandle {
	background-image: url(images/up_down.gif);
	background-repeat:no-repeat;
	background-position:center;                      
	cursor:n-resize;
}
.clear-both{
	clear:both;
}
table tr:first-child{height:33px;text-align:center;}
</style>
<script type="text/javascript" src="js/ddtabmenu.js"></script>
<!--******************Cover**************************-->
<!--<form  action="<?php echo $_SERVER['PHP_SELF']. "?view=modify&amp;".htmlspecialchars(getAllGetParams(array('view'))); ?>" method="post" id="frmPage" name="frmPage">-->
<div class="breadcrumb">
        <a href="<?php echo base_url_admin;?>"><?php echo $lang['HOME'];?></a>
         ::<?php echo $lang['MANAGE_VIDEO']; ?>
      </div>
<div class="box">
<?php 
	if(!empty($Successmsg)){
?>
<div class="warning"><?php echo $Successmsg;?></div>
<?php }?>
<div class="heading">
	<h1><img src="../templates/image/youtube.png" alt="" />
	
			<?php echo $lang['MANAGE_VIDEO']; ?>
	
	</h1>
	<div class="buttons">
	<form  action="#" method="post" id="frmPage" name="frmPage">
	
				 <input id="send" class="button" type="button" name="btnadd" value="<?php echo $lang['ADD_NEW']; ?>" onclick="javascript:window.location.href='index.php?view=add&amp'; return false;" />&nbsp;&nbsp;&nbsp;
	  <input class="button" type="button" name="btnedit" value="<?php echo $lang['EDIT']; ?>"  onclick="EditSelected(document.frmPage,'<?php echo htmlspecialchars(getAllGetParams(array('action','view','id')));?>','No item is selected for Editing!','Page(s)','Edit')" />&nbsp;&nbsp;&nbsp;
            <input class="button" type="button" name="btnpublish" value="<?php echo $lang['PUBLISH']; ?>" onclick="publishSelected(document.frmPage,'','Are you sure want to publish these',1,'Page(s)','process');" />&nbsp;&nbsp;&nbsp;
            <input class="button" type="button" name="btnunpublish" value="<?php echo $lang['UNPUBLISH']; ?>" onclick="publishSelected(document.frmPage,'','Are you sure want to unpublish these',0,'Page(s)','process');" />&nbsp;&nbsp;&nbsp;
            <input class="button" type="button" name="btndelete" value="<?php echo $lang['MY_DEL']; ?>"  onclick="deleteSelected(document.frmPage,'','Page(s)','process');"  />
</div>
</div>
<div class="content">
<div class="row">
<!-- *********** List Information *********************-->

<table class="list">
<thead>
	<tr>
	<td width="3%" align="center"><?php echo $lang['N']; ?></td>
    <td width="3%" align="center" ><input type="checkbox" name="chkall" id="chkall" onClick="checkAll(this.form,this.checked)" style="cursor:pointer;"></th>
    <td width="4%" align="center"><?php echo $lang['VDO_YOUTUBE_ID']; ?></td>
    <td width="15%"><?php echo $lang['VDO_TITLE']; ?>
    <td width="10%"><?php echo $lang['STATUS']; ?></td>
    <td width="15%"><?php echo $lang['CRETE_DATE']; ?></td>
    <td width="20%"><?php echo $lang['MODI_DATE']; ?></td>      
    <td width="10%"><?php echo $lang['OTHER']; ?></td>
</tr>
</thead>
<tbody>
	<?php 
		$qstring = '';
		$rowsPerPage = isset($_GET['num'])?$_GET['num']:'10';
		$LIMIT = 1;
		$sql = "SELECT * FROM ".Tblvdoyoutube::tblvdoyoutube;
		$result     = mysql_query(getPagingQuery($sql, $rowsPerPage));
		$pagingLink = getPagingLink($sql, $rowsPerPage, $qstring);
		$i = 1;
		$j = 0;
		while($row = mysql_fetch_assoc($result)){
			extract($row);
		
			if($i%2){
				$class = 'row1';	
			}else{
				$class = 'row2';	
			}
			$i++;
			$j++;
?>
<tr">
	<td class="p_l" width="3%" align="center"><?php echo $j;?></td>
    <td class="p_l" width="3%" align="center"><input type="checkbox" id="chk<?php echo $i;?>" name="id[]" value="<?php echo $row[Tblvdoyoutube::id];?>" /></td>
    <td class="p_l" width="4%" align="center"><img style="width:80px;" src="http://i1.ytimg.com/vi/<?php echo $row[Tblvdoyoutube::vdo_ytb_id]; ?>/mqdefault.jpg"/></td>
    <td class="p_l" width="15%" align="center"><?php echo $row[Tblvdoyoutube::vdo_title]; ?></td>
    <td class="p_l" width="10%" align="center"><?php echo stateImage($row[Tblvdoyoutube::id],$row[Tblvdoyoutube::vdo_status]);?></td>
    <td class="p_l" width="15%" align="center"><?php echo date('d-m-Y h:m:s',$row[Tblvdoyoutube::date_created]); ?></td>
    <td class="p_l" width="20%" align="center"><?php echo isset($row[Tblvdoyoutube::date_modified])?date('d-m-Y h:m:s',$row[Tblvdoyoutube::date_modified]):"";?></td>
    <td width="10%" align="center">
    		<div class="btn-group">
                <a class="btn btn-primary btn-inverse" href="index.php?view=add&amp;id=<?php echo urlencode($id);?>&amp;edit=edit"><img width="20" src="../templates/image/Edit.gif" alt="<?php echo $lang['EDIT'];?>" /></a>
                <a class="btn btn-primary btn btn-danger" onclick="return ConfirmDelete('process.php?action=delete&amp;id=<?php echo @$id;?>')" href="javascript:;"><img width="20" src="../templates/image/trash.png" alt="<?php echo $lang['DELETE'];?>" /></a>
    		</div>
    </td>
</tr>
</tbody>
<?php 	
		}
?>
</table>
	<div class="row">
    	<div class="span7">
			<div class="wp-pagenavi">
				<?php echo $pagingLink;?>
                <div class="clear"></div>
			</div>
		</div>
           
    </div> 
</form>
</div>
</div>
	</div><!--<div class="row">-->
